<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsf/composite"
      >
    
    <c:interface>
        <c:attribute name="formId" />
        <c:attribute name="nameValue" />
    	<c:attribute name="submitButtonAction" 
    		method-signature="java.lang.String action()" />
    </c:interface>
    
    <c:implementation>
        
        <h:form id="#{cc.attrs.formId}">                       
            <p:panelGrid columns="2">
                <f:facet name="header">
                    <h:outputText value="Přidat ketegorii" />
                </f:facet>

                <h:outputLabel value="Název:" for="name" />
                <p:inputText validatorMessage="Prosím vyplňte název (minimálně 5 znaků, maximálně 20 znaků)" id="name" value="#{cc.attrs.nameValue}">
                    <f:validateLength minimum="5" maximum="20" />
                </p:inputText>

                <f:facet name="footer">
                    <p:commandButton value="Uložit" action="#{cc.attrs.submitButtonAction}" update="#{cc.attrs.formId}"/>
                </f:facet>
            </p:panelGrid>
        </h:form>
    </c:implementation>
</html>

